import Vue from 'vue'
import Router from 'vue-router'

import main from '@/components/main'
import headers from '@/components/headers'
import skins from '@/components/skins'
import editView from '@/components/editView'

Vue.use(Router)

export default new Router({
  scrollBehavior (to, from, savedPosition) {
    if (to.hash) {
      return {
        selector: to.hash
      }
    }
    window.scrollTo(0, 0)
  },
  mode: 'hash',
   routes: [{
    path: '/headers',
    name: 'headers',
    component: headers
  },
  {
    path: '/main',
    name: 'main',
    component: main
  },
  {
    path: '/skins',
    name: 'skins',
    component: skins
  },
  {
    path: '/editView',
    name: 'editView',
    component: editView
  }]
})
